/***************************************************************************
 *   Copyright (C) 2007 by Phillip Aldridge   *
 *   phillip@imi21.com    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#ifndef _METEO2008WIDGET_H_
#define _METEO2008WIDGET_H_
#include <qmenubar.h>
#include <qlabel.h>
#include <qstatusbar.h>
#include <kled.h>
#include <qtabwidget.h>
#include <qprocess.h>
#include <qdir.h>
#include <qtimer.h>
#include <qdatetime.h>
#include <qstringlist.h>
#include <qcheckbox.h>
#include <qtextedit.h>

#include "meteo2008widgetbase.h"
#include "stationdata.h"
#include "database.h"
#include "graphview.h"
#include "iconwind.h"
#include "icontemp.h"
#include "iconforecast.h"
#include "iconbanner.h"
#include "ftp.h"

class meteo2008Widget : public meteo2008WidgetBase
{
    Q_OBJECT

public:
    meteo2008Widget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~meteo2008Widget();

   void start();
   void updateDisplay();
   void updateRequest();
   void testDatabase();
   void updateGraph();
   
   QTimer *timer;
   QProcess *proc;
   Database *database;
   StationData *stationdata;
   FTP *ftp;
   //graphic members;
   QTabWidget *tabViewWidget;
   GraphView *graphNow, *graph24h, *graphWeek;
   GraphView *graphMonth, *graphYear, *graphCustom;
   QTextEdit *textView;
   IconWind *iconWind;
   IconTemp *iconTemp;
   IconForecast *iconForecast;
   IconBanner *iconBanner;
   KLed     *kledStation, *kledDatabase;

   //Station data labels
   QLabel *statusStation, *statusDatabase;
   QLabel *labForecastDate, *labForecastTime;
   QLabel *labTempOutside, *labTempInside, *labTempMax, *labTempMin;
   QLabel *labDewpoint, *labRelHumIn, *labRelHumOut;
   QLabel *labWindChill, *labWindDirection, *labWindAngle,*labWindSpeed;
   QLabel *labRain1h, *labRain24h, *labRain1w, *labRain1m, *labRainTotal;
   QLabel *labAbsPressure, *labRelPressure;
   QLabel *labTendency, * labForecast;


public slots:
   virtual void message(QString m);
   virtual void updateDone();
   virtual void timerRequest();
   virtual void menuStub();
   virtual void menuQuit();
   virtual void menuPrintView();
   virtual void menuCustomRange();
   virtual void menuArchiveData();
   virtual void menuPurgeData();
   virtual void menuStationDlg();
   virtual void menuDatabaseDlg();
   virtual void menuFtpDlg();
   virtual void menuWundergrundDlg();
   virtual void menuPathDlg();
   virtual void menuAutoDlg();
   virtual void menuPublishWebsite();
   virtual void menuPublishWundergrund();
   virtual void menuAbout();


protected:
   QMenuBar    *mainMenu;
   QStatusBar  *statusBar;

   void initDefaults();
   void initObjects();
   void initMenu();
   void initGUI();
   int stationUpdate;
   void  sessionLoad();
   void  sessionSave();
private:
   QString     lastUpdate;
   QPrinter    *printer;

   int sessionStationUpdateInterval;
protected slots:


};

#endif

